<template>
	<view class="member">
		<view class="con_auto member_bg">
			<view class="member_item con_auto" @tap="$navTo('/pages/work/detail/detail?id=' + item.id)">
				<view class="logo">
					<u-image :src="item.avatar" width="100rpx" height="100rpx" radius="20rpx"></u-image>
					<view class="icon">
						<u-icon name="woman" v-if="item.gender == 1"></u-icon>
						<u-icon name="man" v-if="item.gender == 2" color="#FFB6C1"></u-icon>
					</view>
				</view>
				<view class="detail">
					<view class="detail_title">
						{{ item.name }}
						<text v-if="item.mobile">({{ item.mobile }})</text>
					</view>
					<view class="detail_desc">
						累计消费:
						<text style="color: #333">{{ item.price.toFixed(2) }}</text>
					</view>
					<view class="detail_desc">
						累计次数:
						<text style="color: #333">{{ item.number.toFixed(0) }}</text>
					</view>
					<view class="detail_desc">跟进时间:{{ item.follow_time }}</view>
					<view class="detail_desc">会员标签:{{ item.member_tags }}</view>
					<view class="detail_desc" v-if="type == 'birthday' && item.birthday">生日:{{ $u.timeFormat(item.birthday * 1000, 'yyyy年mm月dd日') }}</view>
					<view class="detail_desc" v-if="type == 'marry' && item.marry_time">结婚纪念日:{{ $u.timeFormat(item.marry_time * 1000, 'yyyy年mm月dd日') }}</view>
				</view>
				<view class="right">
					<view class="t">
						<u--image src="/static/icon/work.png" width="50rpx" height="50rpx"></u--image>
						<!-- <image src="/static/icon/work.png"></image> -->
					</view>
					<view class="b">
						<u-icon name="arrow-right"></u-icon>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	name: 'member',
	props: {
		item: {},
		type: {
			type: String,
			default: 'birthday'
		}
	},
	onLoad() {
		uni.setNavigationBarTitle({
			title: '生日'
		});
	},
	data() {
		return {};
	}
};
</script>

<style lang="scss" scoped>
.member_bg {
	background-color: #fff;
	margin-top: 20rpx;
	border-radius: 20rpx;
	.member_item {
		display: flex;
		padding: 20rpx 0;
		.logo {
			position: relative;
			height: 100rpx;
			margin-right: 20rpx;
			.icon {
				position: absolute;
				bottom: 5rpx;
				right: 5rpx;
			}
		}
		.detail {
			flex: 1;
			&_desc {
				font-size: 28rpx;
				color: rgba(51, 51, 51, 0.5);
			}
		}
		.right {
			width: 60rpx;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
		}
	}
}
</style>
